package com.example.springbootdemo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

@SpringBootApplication
// MyBatisPlus mapper扫描
@MapperScan("com.example.springbootdemo")
public class SpringbootDemoApplication implements WebMvcConfigurer {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootDemoApplication.class, args);
    }

    // WebSocket 服务端点管理器
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/**")
                .addResourceLocations(
                        "file:D:\\_文件柜\\yc127_129\\yc127_129\\springboot-demo\\src\\main\\resources\\static/",
                        "file:D:\\_文件柜\\yc127_129\\yc127_129\\login-starter\\src\\main\\resources\\static/",
                        "file:D:\\_文件柜\\yc127_129\\yc127_129\\upload-starter\\src\\main\\resources\\static/");
    }
}
